﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace LPLS.Commons.Enums
{
    //public static class EnumExtensions
    ////{
    ////    public static string GetDescription(this Enum value)
    ////    {
    ////        FieldInfo field = value.GetType().GetField(value.ToString());
    ////        DescriptionAttribute attribute = Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute)) as DescriptionAttribute;

    ////        return attribute == null ? value.ToString() : attribute.Description;
    ////    }

    ////    public static string GetDescriptionFromValue(int value)
    ////    {
    ////        Type enumType = typeof(StatusEnum);
    ////        foreach (var name in Enum.GetNames(enumType))
    ////        {
    ////            if ((int)Enum.Parse(enumType, name) == value)
    ////            {
    ////                return GetDescription((Enum)Enum.Parse(enumType, name));
    ////            }
    ////        }
    ////        return "未知状态";
    ////    }
    //}
}
